package io.adrainty.bolee.insurance.repository;

import io.adrainty.bolee.insurance.models.entity.WarrantyEarningsOrderEntity;
import io.adrainty.bolee.insurance.models.entity.WarrantyEntity;
import io.adrainty.bolee.insurance.models.entity.WarrantyInsuredEntity;
import io.adrainty.bolee.insurance.models.entity.WarrantyOrderEntity;

import java.util.List;

/**
 * @author AdRainty
 * @version V1.0.0
 * @since 2025/8/26 上午12:54
 */
public interface IWarrantyRepository {

    /**
     * 批量保存
     * @param warrantyEarningsOrderList 批量保存的收益订单
     */
    void saveEarningsOrderBatch(List<WarrantyEarningsOrderEntity> warrantyEarningsOrderList);

    /**
     * 保存
     * @param warrantyEntity 保存的数据
     */
    void saveWarranty(WarrantyEntity warrantyEntity);

    /**
     * 更新
     * @param warrantyEntity 更新的数据
     */
    void updateWarranty(WarrantyEntity warrantyEntity);

    /**
     * 批量保存
     * @param orderEntities 批量保存的订单
     */
    void saveOrderBatch(List<WarrantyOrderEntity> orderEntities);

    /**
     * 批量保存
     * @param insuredEntities 批量保存的保单
     */
    void saveInsuredBatch(List<WarrantyInsuredEntity> insuredEntities);

    /**
     * 查询
     * @param queryDTO 查询条件
     * @return 查询结果
     */
    List<WarrantyEntity> queryWarranty(WarrantyEntity queryDTO);

    /**
     * 删除
     * @param id 删除的id
     */
    void deleteWarranty(Long id);

    /**
     * 删除收益订单
     * @param warrantyNo 删除的保单号
     */
    void deleteEarningsOrderByWarrantyNo(String warrantyNo);

    /**
     * 删除保单
     * @param warrantyNo 删除的保单号
     */
    void deleteInsuredByWarrantyNo(String warrantyNo);

    /**
     * 删除订单
     * @param warrantyNo 删除的保单号
     */
    void deleteOrderByWarrantyNo(String warrantyNo);

    /**
     * 删除核保信息
     * @param warrantyNo 删除的保单号
     */
    void deleteVerifyByWarrantyNo(String warrantyNo);

    /**
     * 查询订单
     * @param warrantyOrderId 订单id
     * @return 订单
     */
    WarrantyOrderEntity findValidOrderById(Long warrantyOrderId);
}
